home *** CD-ROM | disk | FTP | other *** search
- /*
- OS Subs.c
-
- */
-
- #include "OS Subs.h"
-
- short NumToolboxTraps(void){
- if (NGetTrapAddress(_InitGraf,ToolTrap)==NGetTrapAddress(0xaa6e,ToolTrap))
- return 0x0200;
- return 0x0400;
- }
-
-
- TrapType GetTrapType(short theTrap){
- #define TrapMask 0x0800
-
- if (theTrap&TrapMask)
- return ToolTrap;
- return OSTrap;
- }
-
- Boolean OurTrapAvailable(short theTrap){
- TrapType tType;
-
- tType=GetTrapType(theTrap);
- if (tType==ToolTrap){
- theTrap &= 0x07ff;
- if (theTrap>NumToolboxTraps())
- theTrap=_Unimplemented;
- }
-
- return (NGetTrapAddress(theTrap,tType)!=NGetTrapAddress(_Unimplemented,ToolTrap));
- }
-